package planets.tests;

import sativa.game.Engine;

import org.lwjgl.LWJGLException;
import junit.framework.TestCase;

/**
 * // ------------------------------------------------------------------------- /** Ensure that the Engine objects perform correctly
 * 
 * @author carlos
 * @version May 10, 2011
 */
public abstract class GameTest extends TestCase
{
	/**
	 * The game to test against
	 */
	private Engine testGame;

	@Override
	public void setUp()
	{
		testGame = getConcrete();
	}

	/**
	 * Gets a concrete object to test with
	 * 
	 * @return A non-abstract Engine object
	 */
	protected abstract Engine getConcrete();

	/**
	 * Make sure execution correctly proceeds
	 */
	public void testExecute()
	{
		Exception occurred = null;

		try
		{
			testGame.execute();
		} catch (Exception e)
		{
			occurred = e;
		}
		assertNull(occurred);
		assertFalse(occurred instanceof LWJGLException);
	}
}